from base import Base
from selenium.webdriver.common.by import By
from time import sleep

class Sousuopage(Base):
    sousuokuang = (By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/androidx.drawerlayout.widget.DrawerLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[2]/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.TextSwitcher/android.widget.TextVie')
    siusuoanniu = (By.XPATH,'android.widget.TextView[@text="搜索"]')
    dy = (By.ID,'com.xiachufang:id/search_suggest_right_text_view')

    def sousuoyewu(self):
        self.find_ele(self.sousuokuang).click()
        sleep(2)
        self.find_ele(self.siusuoanniu).click()
        sleep(3)
    shurukuang = 'new UiSelector().text("搜索菜谱")'
    dy2 = (By.ID,'com.xiachufang:id/tv_content')
    dy3 = (By.XPATH,'//android.widget.TextView[@text="综合"]')
    def sousuoddtyewu(self,neirong):
        self.find_ele(self.sousuokuang).click()
        sleep(2)
        self.find_ele(self.sousuokuang).send_keys(neirong)
        sleep(2)
        self.find_ele(self.siusuoanniu).click()
        sleep(2)



